In modern computer processors, arithmetic units (sometimes also known as arithmetic logic units or ALUs) contain registers and other memory elements that are used to store operands during computations. Conventional arithmetic units include, but are not limited to, integer adders and multipliers as well as floating point units. Typical arithmetic unit operations include addition, subtraction, fixed point multiplying and divide, and floating point computations. Modern processors may also include other on-board (on-chip) memory storage elements, such as RAM, ROM, and PROM. Typical off-board memory, including disk drives and other forms of mass memory storage well known in the art, communicate with the processor by means of conventional circuits.
In operation, the processor fetches operands (i.e., data values that are to be operated upon) from memory, which may be located in any of the above devices, both on-chip and off-chip. The processor loads the fetched operands into a register (or perhaps several registers, depending on processor architecture and the length of the operands) and then performs the appointed operation on them under conventional software control, e.g., via execution of instructions from microcode or RAM in accordance with the processor's control systems.
For example, in a simple addition of operands A and B, where the value A is stored in memory location 001 and the value B is stored in memory location 002, the addition operation begins by fetching A into a first register and B into a second register. When the software controlling the processor is ready to add these two values, it causes the contents of the two registers to be loaded into an adder (in a typical processor) and added together. The processor typically returns the result of the adding to the first register, although in some architectures it may be directed to another register.
One particular error detection method used for mental calculation verification employs digital roots to check integer addition. A conventional digital root (DR) consists of a recursive sum of the digits of a particular number. For example, if integer X is 2298, the digital root of X is 2+2+9+8=21. Recursively adding 2+1 yields 3, which is the DR of 2298. Error detection is achieved by employing the fact that the sum of the digital roots of two numbers A and B is equal to the digital root of the sum of A and B. Thus, one may determine whether the addition of two numbers is correct by adding the DRs of the operands and comparing that sum to the DR of the result of the original addition operation. The same approach may also be used to verify the results of multiplication or division, since the DR of the product of two numbers equals the digital root of the product of the two original numbers' DRs.
Digital roots may also be used to verify the accuracy of a subtraction operation. Conventional subtraction may be performed adding the 10's complement of the subtrahend (the “Y” in “X−Y”) and discarding the carry of the result. In order to verify subtraction using digital roots, one computes the digital roots of the operands (using the 10's complement of the subtrahend) and compares the result of the addition of the digital roots (including the carry) to the digital root of the result of the original subtraction. For example, if X=2298 and Y=1346, to compute X−Y, one takes 2298+(the 10's complement of 1346)=2298+8654=952, discarding the carry. The digital root of X equals 2+2+9+8=21=>3. The digital root of the tens complement of Y equals 8+6+5+4=23 =>5. The sum of these digital roots is 5+3=8. Comparing this to the result of the original subtraction operation including the discarded carry, one sees that the digital root of the result equals 9+5+2+carry 1=17=>8.
In computer systems where data integrity and error-free (or, at a minimum, fault-tolerant) computation is desired, processor designers employ various other schemes for error detection and correction to ensure that bad data is not propagated through the system. Such systems include error detection schemes such as parity bit checking, checksums, error correcting codes (ECC), Hamming codes, Gray codes, and the like. The schemes are typically employed on data stored on disk drives or in RAM or ROM and are generally focused in determining whether the contents of a particular off-processor memory location has been corrupted or damaged.
Fault-tolerant computing systems, by contrast, are generally focused on ensuring that software errors or hardware failures do not necessarily cause cessation of the computing processes. The systems utilize various redundancy schemes and hardware-oriented voting devices to trap erroneous calculations or system failures. Fault-tolerant computing systems may also include memory-focused error detection and/or correction schemes.